﻿using System.Collections.Generic;
using kemocard.Scripts.Common;
using kemocard.Scripts.Module.Battle;
using kemocard.Scripts.MVC;

namespace kemocard.Scripts.Hero;

public class HeroScript
{
    /**
     * Mod可能为null,使用时注意
     */
    protected static BattleModel Mod => GameCore.ControllerMgr.GetControllerModel<BattleModel>(ControllerType.Battle);

    public virtual void UseSkill(BattleCharacter parent, int skillIdx = 0)
    {
    }

    public virtual string GetDesc()
    {
        return "";
    }

    public bool CanUseSkill(BattleCharacter parent, int skillIdx = 1)
    {
        return parent.Power >= SkillPowerCost[skillIdx - 1] &&
               CheckUseSkill(parent);
    }

    protected virtual bool CheckUseSkill(BattleCharacter parent)
    {
        return true;
    }

    public virtual void OnFloorChanged(int floor, bool isFinalFloor)
    {
    }

    public virtual void OnBattleStart()
    {
    }

    public virtual void OnTurnStart(int turnCount)
    {
    }

    public List<int> SkillCoolDown = [4];
    public List<int> SkillPowerCost = [100];
    public BattleCharacter Owner;
}